#include<stdio.h>
#include<time.h>
int F[50]={0};
int fib(int n){
    if(F[n])// query
        return F[n];
    if(n<2) //rec
        return F[n]=1;//memory
    return F[n]=fib(n-1)+fib(n-2);//memory
}

int main()
{
    int n;
    while(1==scanf("%d",&n))
        printf("%d\n",fib(n));

    return 0;
}
